package cart;

import beans.Car;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class Cart {

    private List<Car> items =  new ArrayList();
    private Integer totalCount;

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public Cart() {
    }


    public List<Car> getItems() {
        return items;
    }

    public void setItems(List<Car> items) {
        this.items = items;
    }

    // 删除特定的Id购物项
    public void removeShopCartItem(String goodId){
        this.items.remove(goodId);
    }

    // 清空购物车
    public void removeAll(){
        this.items.clear();
    }

    // 获得总价格
    public BigDecimal getTotalPrice(){
        BigDecimal totalPrice = new BigDecimal(0);

        return totalPrice;
    }


}
